﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="msg_personal_set.aspx.cs" Inherits="Ccit.SysPlat.Remind.msg_personal_set" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>在线消息</title>
    <script language="javascript" src="../script/jsonlib.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
      function doSave()
      {
         if(!checkForm()) return;
         var MsInformSet = {};
         if(document.getElementById("radY").checked == true)
         {
            MsInformSet.PopMsg = document.getElementById("radY").value;
         }
         if(document.getElementById("radN").checked == true)
         {
            MsInformSet.PopMsg = document.getElementById("radN").value;
         }
         var dropDown = new DropDownList("ddlMsgRemind");
         MsInformSet.Tone = dropDown.selectedValue;
         MsInformSet.RemindTime = document.getElementById("txtNextRemindTime").value;
         MsInformSet.RecentPerson = document.getElementById("txtRecentTime").value;
         
         var jsonExpr = JSON.stringify(MsInformSet,function(key,value){return value;});
         PageMethods.SavePersonSet(jsonExpr,ClientCallBack);
     }
     
     function checkForm()
     {
         var bCheck = true;
         var lastRemindTime = document.getElementById("txtNextRemindTime").value;
         var recentTime = document.getElementById("txtRecentTime").value;
         if(lastRemindTime!="" && isNaN(lastRemindTime))
         {
           alert("分钟须为数字");
           bCheck = false;
         }
         if(recentTime != "" && isNaN(recentTime))
         {
            alert("天须为整数");
            bCheck = false;
         }
         return bCheck;
     }
     function ClientCallBack(vResult)
     {
        eval("var vResultObj = " + vResult);
        alert(vResultObj.oMsg);
     }
    </script>
</head>
<body>
    <form id="form1" runat="server">
      
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
      
      <table id="tabMsgSet" class="tableborder" cellpadding="0" runat="server" cellspacing="0" align="center" width="98%"  height="5px" style="margin-top:3px">
         <tr>
           <td align="center">
              <fieldset style="width:98%">
                <legend>在线消息-消息设置</legend>
                 <table cellpadding="0" cellspacing="0" width="100%" align="center" height="3px" >
                  <tr align="center">
                    <td style="width:30%">
                      <nobr>是否弹出消息提醒</nobr> 
                    </td>
                     <td align="left">
                      <nobr><input type="radio" name="radMsgRemind" runat="server" id="radY" value="1" class="radio" checked />是<input type="radio" id="radN" runat="server"  name="radMsgRemind" value="0" class="radio"  />否</nobr> 
                    </td>
                  </tr>
                  <tr align="center">
                    <td style="width:30%">
                      <nobr>消息提示音</nobr> 
                    </td>
                     <td align="left">
                      <nobr>
                       <asp:DropDownList ID="ddlMsgRemind" CssClass="select" runat="server"></asp:DropDownList>
                      </nobr> 
                    </td>
                  </tr>
                  <tr align="center">
                    <td style="width:30%">
                      <nobr>下次提醒时间</nobr> 
                    </td>
                     <td align="left">
                      <nobr>
                        <input type="text" runat="server" class="input" id="txtNextRemindTime" /><font color="red">(分钟)</font>
                      </nobr> 
                    </td>
                  </tr>
                  <tr align="center">
                    <td style="width:30%">
                      <nobr>最近联系人时间</nobr> 
                    </td>
                     <td align="left">
                      <nobr>
                        <input type="text" runat="server"  class="input" id="txtRecentTime" /><font color="red">(天)</font>
                      </nobr> 
                    </td>
                  </tr>
                 </table>
              </fieldset>
           </td>
         </tr>
         <tr class="pformstrip" width="98%">
           <td align="center"><input type="button" class="button" runat="server" id="btnSave" value="保存" onclick="doSave()" /></td>
         </tr>
        </table>
    </form>
</body>
</html>
